<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教练</title>
    <script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
    <style>
        .top-right{
            float: right;
            width: auto;
            height: 50px;
        }
        .top-left{
            float: left;
            width: auto;
            height: 50px;
        }
        .box{
            width:400px;
            height: 200px;
            margin: 100px auto;
            border: 1px #000000 solid;
        }
        .left{
            width:150px;
            height: 200px;
            float: left;
            border: 1px #000000 solid;
        }
        .right{
            width: 248px;
            height:200px;
            float: right;
            /*padding-left: 130px;*/

        }
        .right1{
            list-style-type: none;
            /*height: 150px;*/
        }
       .zan{
           width: 100px;
           height: 50px;
           margin-top: 25px;
           float: right;
       }
    </style>

</head>
<body>
<div class="top-left">
    <a href="/index/index">首页</a>
    <a href="/index/vote">投票</a>
</div>
<div class="top-right">
    {$data['name']}<a href="/index/loginout">退出登录</a>
</div>
{foreach name="coach" item="vo"}
<div class="box">
<div class="left">

</div>

    <div class="right">

<ul class="right1">
    <li>姓名：{$vo.coach}</li>
    <li>编号：{$vo.number}</li>
    <li>学校：{$vo.school}</li>
    <li>人气：{$vo.zannumber}</li>
</ul>
        <input type="button" class="zan" value="支持他" onclick="abc({$vo.zannumber},'{$vo.coach}',{$vo.id})" >

    </div>
</div>
{/foreach}
</body>
<script>
    function abc(a,b,c) {

        $.post('/index/upcoach',{'zannumber':a,'coach':b,'coachid':c,'name':'{$data['name']}','uid':{$data['uid']}},function(data){
            if(data.status ==1){
                alert ('感谢您的支持');
                window.location.href='/index/coach';
            }else{
                alert("您已经支持过了");
                return false;
            }
        },'json')

    }
</script>
</html>